﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:BrokenHouse.Windows.Controls"
                    xmlns:imaging="clr-namespace:BrokenHouse.Windows.Media.Imaging"
                    xmlns:effects="clr-namespace:BrokenHouse.Windows.Media.Effects">
    
    <Style TargetType="{x:Type local:ActiveIcon}" >
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ActiveIcon}">
                    <local:Icon x:Name="PART_Renderer" Source="{TemplateBinding Source}" 
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Margin="{TemplateBinding Padding}"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="ColorTransform" TargetName="PART_Renderer">
                                <Setter.Value>
                                    <imaging:DesaturationTransform Amount="0.8"/>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Opacity" TargetName="PART_Renderer" Value="0.8"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition  Property="IsActive" Value="True"/>
                                <Condition  Property="IsEnabled" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="ColorTransform" TargetName="PART_Renderer">
                                <Setter.Value>
                                    <imaging:GammaCorrectionTransform Gamma="0.8"/>
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
